package main

import "fmt"

type chapterPrint struct {
}

func main() {

	sum := 0

	for i := 0; i < 5; i++ {
		fmt.Printf("i == %d \n", i)
		sum += i

	}

	//格式化打印
	fmt.Printf("sum == %T %v \n", sum, sum)
	i, j := 3, 5
	fmt.Printf("i==%d , j ==%d \n", i, j)

	this := chapterPrint{}
	reverseString := this.reverseString([]byte("123456789"))

	fmt.Println("reverseString == ", reverseString)
}
func (c *chapterPrint) reverseString(arr []byte) string {
	for i, j := 0, len(arr)-1; i < j; i, j = i+1, j-1 {
		arr[i], arr[j] = arr[j], arr[i]
	}
	return string(arr)
}
